home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Telnet 2.7b5 / source / FTPserver / macbinary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-13  |  2.0 KB  |  54 lines  |  [TEXT/CWIE]

  1. #ifdef THINK_C
  2. #pragma options(!align_arrays)    /* BYU 2.4.17 - required for MBHead struct */
  3. #endif
  4.  
  5. #define MB_READ        0
  6. #define MB_WRITE    1
  7. #define MB_DISABLE    0x80
  8. #define    MB_ISASCII    0x40
  9. #define MB_APPEND    0x20
  10.  
  11. typedef struct MBHead {        /* MacBinary Header */
  12.     char zero1;                // 000    Old Version Number - Must be zero
  13.     char nlen;                // 001    Filename - Str63
  14.     char name[63];            // 002
  15.     char type[4];            // 065    Filetype
  16.     char creator[4];        // 069    File Creator Type
  17.     char flags;                // 073    Old Finder Flags
  18.     char zero2;                // 074    Must be zero
  19.     char location[6];        // 075    Location information from Finder info
  20.     char protected;            // 081    Low order bit is "protected" bit
  21.     char zero3;                // 082    Must be zero
  22.     char dflen[4];            // 083    Data Fork Length (bytes)
  23.     char rflen[4];            // 087    Resource Fork Length (bytes)
  24.     char cdate[4];            // 091    Creation Date
  25.     char mdate[4];            // 095    Modification Date
  26.     char ginfolen[2];        // 099    MB 1, but unused by Telnet            JMB 2.6
  27.     char flags2;            // 101    Finder Flags, Low Byte                JMB 2.6
  28.     char undefined[14];        // 102    Currently Undefined (9/93)            JMB 2.6
  29.     char unpckdlen[4];        // 116    Unused by Telnet                    JMB 2.6
  30.     char sechdlen[2];        // 120    Unused by Telnet                    JMB 2.6
  31.     char mb2versnum;        // 122    Uploading Program's version (=129)    JMB 2.6
  32.     char mb2minvers;        // 123    Min version needed (=129)            JMB 2.6
  33.     char crc[2];            // 124    CRC of first 124 bytes                JMB 2.6
  34.     char undefined2[2];        // 126    Currently Undefined (9/93)            JMB 2.6
  35. } MBHead;
  36.  
  37. typedef struct MBFile {
  38.     Str255 name;            /* The filename */
  39.     short
  40.         fd,                    /* Current File Descriptor */
  41.         mode,                /* Are we reading or writing */
  42.         vrefnum,            /* The volume reference number */
  43.         binary,                /* MacBinary active ? */
  44.         sector1,            /* Are we at the first sector of the file */
  45.         fork;                /* 0 if we're writing the DF, 1 if were writing the RF */
  46.     long
  47.         bytes,                /* Length of the current fork */
  48.         rlen,                /* Length of Resource Fork (bytes) */
  49.         dlen,                /* Length of Data Fork (bytes) */
  50.         dirID;                /* The file's dirID */
  51.     MBHead
  52.         header;                /* the first sector... */
  53. } MBFile;
  54.